const express = require('express');
const router = express.Router();
const userController = require('../controller/userController.js');

//处理图片上传
const multer = require("multer");
const User = multer({dest:"./img/User/"});
// 用户登录
router.post('/login',userController.login);
// 用户注册
router.post('/register',User.single('file'),userController.register);
// 获取用户列表
router.post('/list',userController.GetUserList);
// 增加用户
router.post('',User.single('file'),userController.AddUser);
// 修改用户
router.put('',User.single('file'),userController.EditUser);
// 删除用户
router.delete('',userController.DeleteUser);
// 批量删除汽车
router.delete('/BatchDeleteUser',userController.BatchDeleteUser);
// 获取用户详情
router.get('/detail/:id',userController.GetUserDetail);

module.exports = router;